package ru.lposapr.labrab4;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import android.widget.Toast;

public class SecondActivity extends Activity {

	final String TAG = "LabRab4Tag";
	ListView mainListView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_second);

		mainListView = (ListView) findViewById(R.id.pointsListView);

		float xn = getIntent().getFloatExtra("XN", 0);
		float xk = getIntent().getFloatExtra("XK", 0);
		float dx = getIntent().getFloatExtra("DX", 0);

		Log.d(TAG,"1");
		
		int pointsCount = Math.round((xk - xn) / dx);
		Log.d(TAG,"2");
		float points[][] = new float[pointsCount][2];
		Log.d(TAG,"3");
		float x = xn;
		for (int i = 0; i < pointsCount; i++, x = x + dx) {
			points[i][0] = x;
			points[i][1] = x * x;
		}
		Log.d(TAG,"4");
		Log.d(TAG,"count = "+points.length);
		Toast toast = Toast.makeText(getApplicationContext(), " "+points.length, Toast.LENGTH_LONG);
		toast.show();
		
	}
}
